package com.day03_class_object.abstract_class;

/**
 * @ClassName: Demo
 * @Author: 豆豆在睡觉
 * @Create 2024/2/27-23:13
 * @Version 1.0
 */
public class Demo {
    public static void main(String[] args) {
        Animal an = new Cat("加菲猫", 5);
        System.out.println(an.getName()+ "===" + an.getAge());
        an.eat();

        an =  new Dog("豆豆", 2);
        Dog d1 = (Dog) an;
        System.out.println(an.getName() +"---"+an.getAge());
        an.eat();
        d1.walk();
    }
}
